package debby.bdmap.utils

import com.baidu.mapapi.map.BaiduMap

/**
 * Created by debby on 2018/6/11.
 * 描述:百度地图工具
 */

//切换地图
fun changeMap(baidu: BaiduMap) {
    if (baidu.mapType == BaiduMap.MAP_TYPE_SATELLITE)
        baidu.mapType = BaiduMap.MAP_TYPE_NORMAL
    else
        baidu.mapType = BaiduMap.MAP_TYPE_SATELLITE
}

//显示路况
fun showTraffic(baidu: BaiduMap) {
    baidu.isTrafficEnabled = !baidu.isTrafficEnabled
}

//显示热力图
fun showHeat(baidu: BaiduMap) {
    baidu.isBaiduHeatMapEnabled = !baidu.isBaiduHeatMapEnabled
}

//显示POI图
var show: Boolean = true

fun showPoi(baidu: BaiduMap) {
    show = !show
    baidu.showMapPoi(show)
}
